home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re Save Command.3 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.4 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Save Command
  2. Sent:        6/25/96 3:18 AM
  3. Received:    6/25/96 10:33 AM
  4. From:        Richard Rodseth, rodseth@apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >I have a palette icon button that is used to save the current document (a 
  9. >customer request).  When this button is pressed, I need to tell OpenDoc 
  10. >to save the document with the default name (same as cmd-S) in my frame's 
  11. >HandleNotification method.  What is the preferred method to perform this 
  12. >task, given the customer requirements?
  13.  
  14. John,
  15.  
  16. I hope others will weigh in with their opinions. Unfortunately, I don't 
  17. think there is currently a clean way to do this. On the Mac, You could 
  18. make up a dummy menu event record and call ODDispatcher::Dispatch(). 
  19. You'd need to set the "what" field to kODEvtMenu, ask the current menu 
  20. bar for the menu and item number corresponding to the save command, and 
  21. put them in the high and low word of the message field, respectively. 
  22. Ouch!
  23.  
  24. OpenDoc should probably provide a cleaner way. Perhaps a shell API or a 
  25. set of AppleEvent handlers, and utilities to send the events. The problem 
  26. is that a container app would have to support these too.
  27.  
  28. Richard Rodseth
  29.  
  30.  
  31.  
  32.  
  33.  
  34.         "It's no use prevaricating about the bush"
  35.                 - Wallace, in "The Wrong Trousers"
  36.